package com.dwfyc.hibernate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Vehiculo entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "vehiculo", catalog = "firmes", uniqueConstraints = @UniqueConstraint(columnNames = "matricula"))
public class Vehiculo implements java.io.Serializable {

	// Fields

	private Integer idvehiculo;
	private Proveedor proveedor;
	private String matricula;
	private String marca;
	private String modelo;
	private String observaciones;
	private Integer esMarcadoCe;
	private Integer supVelItv;

	// Constructors

	/** default constructor */
	public Vehiculo() {
	}

	/** minimal constructor */
	public Vehiculo(Integer idvehiculo, Proveedor proveedor, String matricula) {
		this.idvehiculo = idvehiculo;
		this.proveedor = proveedor;
		this.matricula = matricula;
	}

	/** full constructor */
	public Vehiculo(Integer idvehiculo, Proveedor proveedor, String matricula,
			String marca, String modelo, String observaciones,
			Integer esMarcadoCe, Integer supVelItv) {
		this.idvehiculo = idvehiculo;
		this.proveedor = proveedor;
		this.matricula = matricula;
		this.marca = marca;
		this.modelo = modelo;
		this.observaciones = observaciones;
		this.esMarcadoCe = esMarcadoCe;
		this.supVelItv = supVelItv;
	}

	// Property accessors
	@Id
	@Column(name = "idvehiculo", unique = true, nullable = false)
	public Integer getIdvehiculo() {
		return this.idvehiculo;
	}

	public void setIdvehiculo(Integer idvehiculo) {
		this.idvehiculo = idvehiculo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idProveedor", nullable = false)
	public Proveedor getProveedor() {
		return this.proveedor;
	}

	public void setProveedor(Proveedor proveedor) {
		this.proveedor = proveedor;
	}

	@Column(name = "matricula", unique = true, nullable = false, length = 50)
	public String getMatricula() {
		return this.matricula;
	}

	public void setMatricula(String matricula) {
		this.matricula = matricula;
	}

	@Column(name = "marca", length = 45)
	public String getMarca() {
		return this.marca;
	}

	public void setMarca(String marca) {
		this.marca = marca;
	}

	@Column(name = "modelo", length = 45)
	public String getModelo() {
		return this.modelo;
	}

	public void setModelo(String modelo) {
		this.modelo = modelo;
	}

	@Column(name = "observaciones", length = 200)
	public String getObservaciones() {
		return this.observaciones;
	}

	public void setObservaciones(String observaciones) {
		this.observaciones = observaciones;
	}

	@Column(name = "esMarcadoCE")
	public Integer getEsMarcadoCe() {
		return this.esMarcadoCe;
	}

	public void setEsMarcadoCe(Integer esMarcadoCe) {
		this.esMarcadoCe = esMarcadoCe;
	}

	@Column(name = "sup_vel_ITV")
	public Integer getSupVelItv() {
		return this.supVelItv;
	}

	public void setSupVelItv(Integer supVelItv) {
		this.supVelItv = supVelItv;
	}

}